//
//  PicturePickerCollection.swift
//  照片选择
//
//  Created by 吕昱坪 on 15/12/19.
//  Copyright © 2015年 itcast. All rights reserved.
//

import UIKit

private let PicturePickerCellId = "PicturePickerCellId"

class PicturePickerCollection: UICollectionViewController {
    
    init(){
        
        super.init(collectionViewLayout: UICollectionViewFlowLayout())
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        
      collectionView?.backgroundColor = UIColor(white: 0.9, alpha: 1.0)
        
        //注册可重用Cell
    self.collectionView!.registerClass(UICollectionViewCell.self, forCellWithReuseIdentifier: PicturePickerCellId)
    
    }
    
}

 extension PicturePickerController {

override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
               return 10
    }

    override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCellWithReuseIdentifier(PicturePickerCellId, forIndexPath: indexPath)
    
        cell.backgroundColor = UIColor.redColor()
    
        return cell
    }

   
}
